<ion-view view-title="销售中的商品">

	<!--<ion-nav-buttons side="right">
		<button class="button button-clear icon ion-android-done font-1rem-my" on-tap="change_storeAndPrice()"></button>
	</ion-nav-buttons>-->
	
	<div class="bar bar-subheader stable-bg">
		<div class="row text-center padding-0 font-large-my">
			<div class="col text-center" on-tap="sortByPrice()" ng-class="{'assertive':order==2||order==3}">
				价格&nbsp;
				<i class="icon ion-ios-arrow-up icon-i-my paixu_top " ng-class="{'font-gray-my':order==3}" style="top: 5px;"></i>
				<i class="icon ion-ios-arrow-down icon-i-my paixu_bottom" ng-class="{'font-gray-my':order==2}" style="bottom: 5px;"></i>
			</div>
			<div class="col text-center" on-tap="sortByCount()" ng-class="{'assertive':order==4||order==5}">
				销量&nbsp;
				<i class="icon ion-ios-arrow-up icon-i-my paixu_top" ng-class="{'font-gray-my':order==5}" style="top: 5px;"></i>
				<i class="icon ion-ios-arrow-down icon-i-my paixu_bottom" ng-class="{'font-gray-my':order==4}" style="bottom: 5px;"></i>
			</div>
			<div class="col" on-tap="openRightMenu()">
				筛选<i class="iconfont icon-shaixuan"></i>
			</div>
		</div>
	</div>

	<ion-side-menus>
		<ion-side-menu-content drag-content="false">
			<ion-content class="has-footer has-subheader">
				<ion-refresher  pulling-text="下拉刷新..." on-refresh="doRefresh()"></ion-refresher>
				
				<div class="font-large-my font-gray-my text-center padding" ng-if="goods.length==0||goods==null">
					<i class="icon ion-sad-outline font-1rem-my"></i>
					对不起，没有符合条件的商品.....
				</div>
				
				<div class="list list-borderless" ng-repeat="good in goods">
					<li class="item item-input-inset padding-5">
						<label class="checkbox checkbox-square padding-0">
             				<input type="checkbox" id="{{good.goods_id}}" class="checkbox_goodid" value="{{good.goods_id}}" ng-model="productModel.danModel[$index]" on-tap="checkEven()"/><!--checkbox_goodid只是作为js的选择标志-->
           				</label><label for="{{good.goods_id}}">{{good.goods_id}}</label>
					</li>
					<div class="item padding-0">
						<div class="row padding-0">
							<div class="col-30 item-image col-offset-3">
								<img src="{{good.image_default}}" ng-if="good.image_default"/>
								<img src="{{noImg}}" ng-if="good.image_default==''||good.image_default==null"/>
							</div>
							<div class="col col-67">
								<p class="ellipsis-2">{{good.name}}</p>
								<p>
									<span class="border-radius-my bian_gray royal font-small-my" style="padding: 0 5px;" ng-if="good.is_new">新品</span>
									<span class="border-radius-my bian_gray assertive font-small-my" ng-class="{'margin-left-10-my':goods.is_new}" style="padding: 0 5px;" ng-if="good.is_hot">热买</span>
									<span class="border-radius-my bian_gray positive font-small-my" ng-class="{'margin-left-10-my':goods.is_new||goods.is_hot}" style="padding: 0 5px;" ng-if="good.is_free">免邮</span>
								</p>
								<div class="clear_zhang"></div>
								<p><span class="assertive">{{good.price | currency:'¥'}}</span><span class="font-gray-my right-zhang">销量{{good.buy_count}}</span></p>
							</div>
						</div>
					</div>
					<div class="item padding-0">
						<div class="row padding-0 text-center font-gray-my font-large-my" style="line-height:34px;">
							<div class="col">库存<span class="assertive">{{good.store}}</span>件</div>
							<div class="col">冻结{{good.freez}}件</div>
							<div class="col font-middle-my">{{good.uptime}}</div>
						</div>
					</div>
				</div>
				<ion-infinite-scroll ng-if="!isLoad" immediate-check="false" on-infinite="doRefreshMore()" distance="1%"></ion-infinite-scroll>
			</ion-content>

			<div class="bar bar-footer padding-0">
				<div class="tabs" style="line-height: 44px;">
					<div class="tab-item">
						<div class="item-checkbox">
							<label class="checkbox checkbox-square">
				 				<input type="checkbox" ng-model="productModel.is_all" ng-click="getCheckBox()"/>
				 		  	</label>
						<span style="margin-left: -3rem;">全选</span>
						</div>
					</div>
					<div class="tab-item energized-bg" on-tap="update_goods()"><span class="light">下 架</span></div>
					<!--只有制造商才可以删除-->
					<div class="tab-item assertive-bg" on-tap="delete_goods()" ng-if="user_type==1"><span class="light">删 除</span></div>
					<div class="tab-item bg-DDD" on-tap="delete_goods_noRight()" ng-if="user_type!=1"><span class="light">删 除</span></div>
				</div>
				<!--<div class="row padding-0 text-center">ng-if="user_type==1"
					<div class="col" ng-click="getCheckBox()">
						<div class="item-checkbox">
							<label class="checkbox checkbox-square">
				 				<input type="checkbox" ng-model="productModel.is_all" />
				 		  	</label>
						</div>全选
					</div>
					<div class="col energized-bg light" on-tap="update_goods()">下 架</div>
					<div class="col assertive-bg light" on-tap="delete_goods()">删 除</div>
				</div>-->
			</div>
		</ion-side-menu-content>


		<ion-side-menu side="right">
		<ion-content class="has-subheader">
          <div class="list list-borderless">
                      <li class="item item-input padding-5 item-input-inset item-icon-right">
                         <label class="item-input-wrapper">
                          <input type="text" placeholder="请输入关键词" ng-model="input.key"/>
                         </label>
                         <i class="icon ion-android-close placeholder-icon font-1rem-my" on-tap="initKey()"></i>
                      </li>
                      <li class="item font-small-my padding-0 text-center">
                            <div class="row padding-0">
                                <div class="col font-large-my" ng-click="getType($event,'new')">普通</div>
					   	  		<div class="col font-large-my" ng-click="getType($event,'second')">二手</div>
					   	  		<div class="col font-large-my" ng-click="getType($event,'unsalable')">滞销</div>
					   	  		<div class="col font-large-my" ng-click="getType($event,'rent')">租赁</div>
					   	  		<div class="col font-large-my" ng-click="getType($event,'transfer')">转让</div>
					   	  		<div class="col font-large-my" ng-click="getType($event,'parts')">配件</div>
                            </div>
                      </li>
					  <div class="item item-input item-select" data-tap-disabled="true" style="padding:0 30px 0 15px;">
							<div class="input-label">品牌：</div>
							<div class="input-value" ng-click="doSelectbrand()">{{scope.brand_select.name}}</div>
						</div>
                      <li class="item padding-0">
                        <hr width="90%" size="1" color="#D1D3D6"/>
                      </li>
					  <div class="item item-input item-select" data-tap-disabled="true" style="padding:0 30px 0 15px;">
							<div class="input-label">大分类</div>
							<div class="input-value" ng-click="doSelectCat1()">{{input.cat1.name}}</div>
						</div>
						<div class="item item-input item-select" data-tap-disabled="true" style="padding:0 30px 0 15px;">
							<div class="input-label">中分类</div>
							<div class="input-value" ng-click="doSelectCat2()">{{input.cat2.name}}</div>
						</div>
						<div class="item item-input item-select" data-tap-disabled="true" style="padding:0 30px 0 15px;">
							<div class="input-label">小分类</div>
							<div class="input-value" ng-click="doSelectCat3()">{{input.cat3.name}}</div>
						</div>

                        <li class="item padding-0">
                        <hr width="90%" size="1" color="#D1D3D6"/>
                      </li>

                       <li class="item item-input">
                    	   价格
                      </li>
                       <li class="item item-input-inset padding-5">
                        <input type="text" placeholder="最低价" class="col col-40 text-center" ng-model="filter.price_from"/>
                        <div  class="col col-20 text-center stable-bg">——</div>
                        <input type="text" placeholder="最高价"  class="col col-40 text-center" ng-model="filter.price_to"/>
                      </li>
                   </div>

					<div class="row">
						<div class="col"><button class="button button-full button-energized" on-tap="reset()">重置</button></div>
						<div class="col"><button class="button button-full button-assertive" on-tap="search()">确定</button></div>
					</div>
            </ion-content>
		</ion-side-menu>

	</ion-side-menus>
</ion-view>